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); |
} |