summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPresubmit Automerger Backend <android-build-presubmit-automerger-backend@system.gserviceaccount.com>2022-08-26 21:06:20 +0000
committerPresubmit Automerger Backend <android-build-presubmit-automerger-backend@system.gserviceaccount.com>2022-08-26 21:06:20 +0000
commit8a0914bc271cea3bf66d8f62b1e2fc62f7e77bad (patch)
treefb5f027b6d2c1bad6b57e0599b831b4d27bc7a01
parent14cfc440750104896054c8b04ad824c8b02fdb2e (diff)
parent75f888c634a894c2960cf04ba1a5a5173f2759b1 (diff)
downloadmobile-data-download-8a0914bc271cea3bf66d8f62b1e2fc62f7e77bad.tar.gz
[automerge] Disable persistent bookkeeping if dedupDownloadWithEtag is false. 2p: 75f888c634
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/mobile-data-download/+/19753984 Bug: 243926815 Change-Id: I7b8912abf78ca77ffc62287de6ac262a43c98c79
-rw-r--r--java/com/google/android/libraries/mobiledatadownload/populator/ManifestFileGroupPopulator.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/java/com/google/android/libraries/mobiledatadownload/populator/ManifestFileGroupPopulator.java b/java/com/google/android/libraries/mobiledatadownload/populator/ManifestFileGroupPopulator.java
index 66d26ab..422470e 100644
--- a/java/com/google/android/libraries/mobiledatadownload/populator/ManifestFileGroupPopulator.java
+++ b/java/com/google/android/libraries/mobiledatadownload/populator/ManifestFileGroupPopulator.java
@@ -481,6 +481,16 @@ public final class ManifestFileGroupPopulator implements FileGroupPopulator {
LogUtil.d("%s: Prepare for downloading manifest file.", TAG);
if (!dedupDownloadWithEtag) {
+ LogUtil.d(
+ "%s: Not relying on etag to dedup manifest -- forcing re-download; urlToDownload = %s;"
+ + " manifestFileUri = %s",
+ TAG, urlToDownload, manifestFileUri);
+ try {
+ deleteManifestFileChecked(manifestFileUri);
+ } catch (DownloadException e) {
+ return immediateFailedFuture(e);
+ }
+ bookkeepingRef.set(createDefaultManifestFileBookkeeping(urlToDownload));
return immediateVoidFuture();
}
@@ -531,6 +541,10 @@ public final class ManifestFileGroupPopulator implements FileGroupPopulator {
LogUtil.d("%s: Finalize for downloading manifest file.", TAG);
if (!dedupDownloadWithEtag) {
+ LogUtil.d(
+ "%s: Not relying on etag to dedup manifest, so the downloaded manifest is"
+ + " assumed to be the latest; urlToDownload = %s, manifestFileUri = %s",
+ TAG, urlToDownload, manifestFileUri);
return immediateVoidFuture();
}