• Jeff Sharkey's avatar
    Clear identity when deleting scanned entry. · 01dee865
    Jeff Sharkey authored
    When deleting a file from DownloadManager, we also reach over and
    clean up any scanned MediaStore entries.  However, DownloadManager
    clients may not hold the WRITE_EXTERNAL_STORAGE permission, such as
    when they downloaded a file into their package-specific directories.
    
    The safest fix for now is to clear the calling identity and always
    clean up the MediaStore entries ourselves, since DownloadProvider
    always holds the required storage permission.
    
    Bug: 29777504
    Change-Id: Iea8f5696410010807b118bb56e5b897c53f0e1fe
    01dee865
DownloadProvider.java 61.2 KB