Clear identity when deleting scanned entry.
authorJeff Sharkey <jsharkey@android.com>
Tue, 28 Jun 2016 16:07:48 +0000 (10:07 -0600)
committerJeff Sharkey <jsharkey@google.com>
Tue, 28 Jun 2016 16:08:40 +0000 (16:08 +0000)
commit01dee865054aedb9aa7e90a8ef2c556e19af95e1
tree117825efc3760b656d3d5a0ae689922433a6fa6c
parent3a4a3e7cd5a379e7e757177826ba935f000eb455
Clear identity when deleting scanned entry.

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
src/com/android/providers/downloads/DownloadProvider.java