Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2310)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java

Issue 2705283003: Added last_access_time to DownloadItem and History DB (Closed)
Patch Set: rebase origin/master Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
index 3eacfd0dd893c5adee1cdb02496f47418e539ef1..e339403e39051e9337abc2ae7336ddd45cb8bfe2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
@@ -1067,6 +1067,9 @@ public class DownloadManagerService extends BroadcastReceiver implements
/** See {@link #openDownloadedContent(Context, String, boolean, long)}. */
protected void openDownloadedContent(final DownloadInfo downloadInfo, final long downloadId) {
+ // TODO(shaktisahu): Move this to the broader openDownloadedContent() or a better place if
+ // possible.
+ updateLastAccessTime(downloadInfo.getDownloadGuid(), downloadInfo.isOffTheRecord());
openDownloadedContent(mContext, downloadInfo.getFilePath(),
isSupportedMimeType(downloadInfo.getMimeType()), downloadId);
}
@@ -1777,6 +1780,16 @@ public class DownloadManagerService extends BroadcastReceiver implements
return mAutoResumptionLimit;
}
+ /**
+ * Updates the last access time of a download.
+ * @param downloadGuid Download GUID.
+ * @param isOffTheRecord Whether the download is off the record.
+ */
+ @Override
+ public void updateLastAccessTime(String downloadGuid, boolean isOffTheRecord) {
+ nativeUpdateLastAccessTime(getNativeDownloadManagerService(), downloadGuid, isOffTheRecord);
+ }
+
@Override
public void onMaxBandwidthChanged(double maxBandwidthMbps) {}
@@ -1809,4 +1822,6 @@ public class DownloadManagerService extends BroadcastReceiver implements
long nativeDownloadManagerService, boolean isOffTheRecord);
private native void nativeCheckForExternallyRemovedDownloads(
long nativeDownloadManagerService, boolean isOffTheRecord);
+ private native void nativeUpdateLastAccessTime(
+ long nativeDownloadManagerService, String downloadGuid, boolean isOffTheRecord);
}

Powered by Google App Engine
This is Rietveld 408576698