Merge "Trigger a mediascan when downloads get renamed." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5af9bed265
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user