Merge "Merge \"Build both filename views before deleting.\" into nyc-mr1-dev am: fff6a11438" into nyc-mr1-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
40a4bf7dc1
@@ -484,6 +484,8 @@ public class ExternalStorageProvider extends DocumentsProvider {
|
|||||||
@Override
|
@Override
|
||||||
public void deleteDocument(String docId) throws FileNotFoundException {
|
public void deleteDocument(String docId) throws FileNotFoundException {
|
||||||
final File file = getFileForDocId(docId);
|
final File file = getFileForDocId(docId);
|
||||||
|
final File visibleFile = getFileForDocId(docId, true);
|
||||||
|
|
||||||
final boolean isDirectory = file.isDirectory();
|
final boolean isDirectory = file.isDirectory();
|
||||||
if (isDirectory) {
|
if (isDirectory) {
|
||||||
FileUtils.deleteContents(file);
|
FileUtils.deleteContents(file);
|
||||||
@@ -492,7 +494,6 @@ public class ExternalStorageProvider extends DocumentsProvider {
|
|||||||
throw new IllegalStateException("Failed to delete " + file);
|
throw new IllegalStateException("Failed to delete " + file);
|
||||||
}
|
}
|
||||||
|
|
||||||
final File visibleFile = getFileForDocId(docId, true);
|
|
||||||
if (visibleFile != null) {
|
if (visibleFile != null) {
|
||||||
final ContentResolver resolver = getContext().getContentResolver();
|
final ContentResolver resolver = getContext().getContentResolver();
|
||||||
final Uri externalUri = MediaStore.Files.getContentUri("external");
|
final Uri externalUri = MediaStore.Files.getContentUri("external");
|
||||||
|
|||||||
Reference in New Issue
Block a user