Merge "Trigger a mediascan when downloads get renamed." into qt-dev

am: 5af9bed265

Change-Id: I3a8e60588539b1502686f170f52b31f182ec9869
This commit is contained in:
Sudheer Shanka
2019-05-23 16:07:37 -07:00
committed by android-build-merger

View File

@@ -41,6 +41,7 @@ import android.os.FileUtils;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.provider.Downloads;
import android.provider.MediaStore;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.text.TextUtils;
@@ -1309,6 +1310,11 @@ public class DownloadManager {
"Failed to rename file from " + before + " to " + after);
}
// TODO: DownloadProvider.update() should take care of updating corresponding
// MediaProvider entries.
MediaStore.scanFile(context, before);
MediaStore.scanFile(context, after);
final ContentValues values = new ContentValues();
values.put(Downloads.Impl.COLUMN_TITLE, displayName);
values.put(Downloads.Impl._DATA, after.toString());