summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKweku Adams <kwekua@google.com>2019-06-14 11:24:35 -0700
committerMichael Bestas <mkbestas@lineageos.org>2020-05-23 22:58:16 +0300
commitdfbf1ba55691a752d980d32e64173eb087cf0ae6 (patch)
treeb8554ccec384beb97a6156c22e8ca6a55aeea9d5
parent71f7dca9833391f3fa34e8bcf9198a9dffc13df5 (diff)
downloadandroid_packages_providers_DownloadProvider-dfbf1ba55691a752d980d32e64173eb087cf0ae6.tar.gz
android_packages_providers_DownloadProvider-dfbf1ba55691a752d980d32e64173eb087cf0ae6.tar.bz2
android_packages_providers_DownloadProvider-dfbf1ba55691a752d980d32e64173eb087cf0ae6.zip
Switch from deprecated/removed JobInfo method.
JobInfo.setEstimatedBytes(long) was deprecated and tagged with @removed before Pie shipped but DownloadProvider continued to use the deprecated method. Switching DownloadProvider over to the public method so the deprecated method can be removed. Bug: 130692844 Bug: 135214188 Test: atest com.android.server.job.controllers.ConnectivityControllerTest Test: atest com.android.providers.downloads.DownloadProviderFunctionalTest Change-Id: I5506079ee06e75f7394814fc967df21a4a86341d (cherry picked from commit a8d67ad37081951fde57ed494730f86e595ba709)
-rw-r--r--src/com/android/providers/downloads/Helpers.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java
index 57cdf04a..a34097d3 100644
--- a/src/com/android/providers/downloads/Helpers.java
+++ b/src/com/android/providers/downloads/Helpers.java
@@ -54,7 +54,6 @@ import android.text.TextUtils;
import android.util.Log;
import android.util.LongSparseArray;
import android.util.SparseArray;
-import android.util.SparseBooleanArray;
import android.webkit.MimeTypeMap;
import com.android.internal.util.ArrayUtils;
@@ -192,9 +191,10 @@ public class Helpers {
if (info.mCurrentBytes > 0 && !TextUtils.isEmpty(info.mETag)) {
// If we're resuming an in-progress download, we only need to
// download the remaining bytes.
- builder.setEstimatedNetworkBytes(info.mTotalBytes - info.mCurrentBytes);
+ builder.setEstimatedNetworkBytes(info.mTotalBytes - info.mCurrentBytes,
+ JobInfo.NETWORK_BYTES_UNKNOWN);
} else {
- builder.setEstimatedNetworkBytes(info.mTotalBytes);
+ builder.setEstimatedNetworkBytes(info.mTotalBytes, JobInfo.NETWORK_BYTES_UNKNOWN);
}
}